3.21 \(\int \frac{(a+b \sin (c+d x^2))^2}{x^2} \, dx\)

Optimal. Leaf size=187 \[ -\frac{2 a^2+b^2}{2 x}+2 \sqrt{2 \pi } a b \sqrt{d} \cos (c) \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} \sqrt{d} x\right )-2 \sqrt{2 \pi } a b \sqrt{d} \sin (c) S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )-\frac{2 a b \sin \left (c+d x^2\right )}{x}+\sqrt{\pi } b^2 \sqrt{d} \sin (2 c) \text{FresnelC}\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+\sqrt{\pi } b^2 \sqrt{d} \cos (2 c) S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x} \]

[Out]

-(2*a^2 + b^2)/(2*x) + (b^2*Cos[2*c + 2*d*x^2])/(2*x) + 2*a*b*Sqrt[d]*Sqrt[2*Pi]*Cos[c]*FresnelC[Sqrt[d]*Sqrt[
2/Pi]*x] + b^2*Sqrt[d]*Sqrt[Pi]*Cos[2*c]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]] - 2*a*b*Sqrt[d]*Sqrt[2*Pi]*FresnelS[
Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c] + b^2*Sqrt[d]*Sqrt[Pi]*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c] - (2*a*b*Sin[c +
 d*x^2])/x

________________________________________________________________________________________

Rubi [A]  time = 0.16243, antiderivative size = 187, normalized size of antiderivative = 1., number of steps used = 11, number of rules used = 8, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.444, Rules used = {3403, 6, 3388, 3353, 3352, 3351, 3387, 3354} \[ -\frac{2 a^2+b^2}{2 x}+2 \sqrt{2 \pi } a b \sqrt{d} \cos (c) \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} \sqrt{d} x\right )-2 \sqrt{2 \pi } a b \sqrt{d} \sin (c) S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )-\frac{2 a b \sin \left (c+d x^2\right )}{x}+\sqrt{\pi } b^2 \sqrt{d} \sin (2 c) \text{FresnelC}\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+\sqrt{\pi } b^2 \sqrt{d} \cos (2 c) S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x} \]

Antiderivative was successfully verified.

[In]

Int[(a + b*Sin[c + d*x^2])^2/x^2,x]

[Out]

-(2*a^2 + b^2)/(2*x) + (b^2*Cos[2*c + 2*d*x^2])/(2*x) + 2*a*b*Sqrt[d]*Sqrt[2*Pi]*Cos[c]*FresnelC[Sqrt[d]*Sqrt[
2/Pi]*x] + b^2*Sqrt[d]*Sqrt[Pi]*Cos[2*c]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]] - 2*a*b*Sqrt[d]*Sqrt[2*Pi]*FresnelS[
Sqrt[d]*Sqrt[2/Pi]*x]*Sin[c] + b^2*Sqrt[d]*Sqrt[Pi]*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c] - (2*a*b*Sin[c +
 d*x^2])/x

Rule 3403

Int[((e_.)*(x_))^(m_.)*((a_.) + (b_.)*Sin[(c_.) + (d_.)*(x_)^(n_)])^(p_), x_Symbol] :> Int[ExpandTrigReduce[(e
*x)^m, (a + b*Sin[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && IGtQ[p, 1] && IGtQ[n, 0]

Rule 6

Int[(u_.)*((w_.) + (a_.)*(v_) + (b_.)*(v_))^(p_.), x_Symbol] :> Int[u*((a + b)*v + w)^p, x] /; FreeQ[{a, b}, x
] &&  !FreeQ[v, x]

Rule 3388

Int[Cos[(c_.) + (d_.)*(x_)^(n_)]*((e_.)*(x_))^(m_), x_Symbol] :> Simp[((e*x)^(m + 1)*Cos[c + d*x^n])/(e*(m + 1
)), x] + Dist[(d*n)/(e^n*(m + 1)), Int[(e*x)^(m + n)*Sin[c + d*x^n], x], x] /; FreeQ[{c, d, e}, x] && IGtQ[n,
0] && LtQ[m, -1]

Rule 3353

Int[Sin[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Sin[c], Int[Cos[d*(e + f*x)^2], x], x] + Dist[
Cos[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rule 3352

Int[Cos[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelC[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3351

Int[Sin[(d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Simp[(Sqrt[Pi/2]*FresnelS[Sqrt[2/Pi]*Rt[d, 2]*(e + f*x)])/
(f*Rt[d, 2]), x] /; FreeQ[{d, e, f}, x]

Rule 3387

Int[((e_.)*(x_))^(m_)*Sin[(c_.) + (d_.)*(x_)^(n_)], x_Symbol] :> Simp[((e*x)^(m + 1)*Sin[c + d*x^n])/(e*(m + 1
)), x] - Dist[(d*n)/(e^n*(m + 1)), Int[(e*x)^(m + n)*Cos[c + d*x^n], x], x] /; FreeQ[{c, d, e}, x] && IGtQ[n,
0] && LtQ[m, -1]

Rule 3354

Int[Cos[(c_) + (d_.)*((e_.) + (f_.)*(x_))^2], x_Symbol] :> Dist[Cos[c], Int[Cos[d*(e + f*x)^2], x], x] - Dist[
Sin[c], Int[Sin[d*(e + f*x)^2], x], x] /; FreeQ[{c, d, e, f}, x]

Rubi steps

\begin{align*} \int \frac{\left (a+b \sin \left (c+d x^2\right )\right )^2}{x^2} \, dx &=\int \left (\frac{a^2}{x^2}+\frac{b^2}{2 x^2}-\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x^2}+\frac{2 a b \sin \left (c+d x^2\right )}{x^2}\right ) \, dx\\ &=\int \left (\frac{a^2+\frac{b^2}{2}}{x^2}-\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x^2}+\frac{2 a b \sin \left (c+d x^2\right )}{x^2}\right ) \, dx\\ &=-\frac{2 a^2+b^2}{2 x}+(2 a b) \int \frac{\sin \left (c+d x^2\right )}{x^2} \, dx-\frac{1}{2} b^2 \int \frac{\cos \left (2 c+2 d x^2\right )}{x^2} \, dx\\ &=-\frac{2 a^2+b^2}{2 x}+\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x}-\frac{2 a b \sin \left (c+d x^2\right )}{x}+(4 a b d) \int \cos \left (c+d x^2\right ) \, dx+\left (2 b^2 d\right ) \int \sin \left (2 c+2 d x^2\right ) \, dx\\ &=-\frac{2 a^2+b^2}{2 x}+\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x}-\frac{2 a b \sin \left (c+d x^2\right )}{x}+(4 a b d \cos (c)) \int \cos \left (d x^2\right ) \, dx+\left (2 b^2 d \cos (2 c)\right ) \int \sin \left (2 d x^2\right ) \, dx-(4 a b d \sin (c)) \int \sin \left (d x^2\right ) \, dx+\left (2 b^2 d \sin (2 c)\right ) \int \cos \left (2 d x^2\right ) \, dx\\ &=-\frac{2 a^2+b^2}{2 x}+\frac{b^2 \cos \left (2 c+2 d x^2\right )}{2 x}+2 a b \sqrt{d} \sqrt{2 \pi } \cos (c) C\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )+b^2 \sqrt{d} \sqrt{\pi } \cos (2 c) S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )-2 a b \sqrt{d} \sqrt{2 \pi } S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right ) \sin (c)+b^2 \sqrt{d} \sqrt{\pi } C\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right ) \sin (2 c)-\frac{2 a b \sin \left (c+d x^2\right )}{x}\\ \end{align*}

Mathematica [A]  time = 0.514054, size = 184, normalized size = 0.98 \[ \frac{-2 a^2+4 \sqrt{2 \pi } a b \sqrt{d} x \cos (c) \text{FresnelC}\left (\sqrt{\frac{2}{\pi }} \sqrt{d} x\right )-4 \sqrt{2 \pi } a b \sqrt{d} x \sin (c) S\left (\sqrt{d} \sqrt{\frac{2}{\pi }} x\right )-4 a b \sin \left (c+d x^2\right )+2 \sqrt{\pi } b^2 \sqrt{d} x \sin (2 c) \text{FresnelC}\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+2 \sqrt{\pi } b^2 \sqrt{d} x \cos (2 c) S\left (\frac{2 \sqrt{d} x}{\sqrt{\pi }}\right )+b^2 \cos \left (2 \left (c+d x^2\right )\right )-b^2}{2 x} \]

Antiderivative was successfully verified.

[In]

Integrate[(a + b*Sin[c + d*x^2])^2/x^2,x]

[Out]

(-2*a^2 - b^2 + b^2*Cos[2*(c + d*x^2)] + 4*a*b*Sqrt[d]*Sqrt[2*Pi]*x*Cos[c]*FresnelC[Sqrt[d]*Sqrt[2/Pi]*x] + 2*
b^2*Sqrt[d]*Sqrt[Pi]*x*Cos[2*c]*FresnelS[(2*Sqrt[d]*x)/Sqrt[Pi]] - 4*a*b*Sqrt[d]*Sqrt[2*Pi]*x*FresnelS[Sqrt[d]
*Sqrt[2/Pi]*x]*Sin[c] + 2*b^2*Sqrt[d]*Sqrt[Pi]*x*FresnelC[(2*Sqrt[d]*x)/Sqrt[Pi]]*Sin[2*c] - 4*a*b*Sin[c + d*x
^2])/(2*x)

________________________________________________________________________________________

Maple [A]  time = 0.014, size = 137, normalized size = 0.7 \begin{align*} -{\frac{1}{x} \left ({a}^{2}+{\frac{{b}^{2}}{2}} \right ) }-{\frac{{b}^{2}}{2} \left ( -{\frac{\cos \left ( 2\,d{x}^{2}+2\,c \right ) }{x}}-2\,\sqrt{d}\sqrt{\pi } \left ( \cos \left ( 2\,c \right ){\it FresnelS} \left ( 2\,{\frac{x\sqrt{d}}{\sqrt{\pi }}} \right ) +\sin \left ( 2\,c \right ){\it FresnelC} \left ( 2\,{\frac{x\sqrt{d}}{\sqrt{\pi }}} \right ) \right ) \right ) }+2\,ab \left ( -{\frac{\sin \left ( d{x}^{2}+c \right ) }{x}}+\sqrt{d}\sqrt{2}\sqrt{\pi } \left ( \cos \left ( c \right ){\it FresnelC} \left ({\frac{x\sqrt{d}\sqrt{2}}{\sqrt{\pi }}} \right ) -\sin \left ( c \right ){\it FresnelS} \left ({\frac{x\sqrt{d}\sqrt{2}}{\sqrt{\pi }}} \right ) \right ) \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+b*sin(d*x^2+c))^2/x^2,x)

[Out]

-(a^2+1/2*b^2)/x-1/2*b^2*(-1/x*cos(2*d*x^2+2*c)-2*d^(1/2)*Pi^(1/2)*(cos(2*c)*FresnelS(2*x*d^(1/2)/Pi^(1/2))+si
n(2*c)*FresnelC(2*x*d^(1/2)/Pi^(1/2))))+2*a*b*(-1/x*sin(d*x^2+c)+d^(1/2)*2^(1/2)*Pi^(1/2)*(cos(c)*FresnelC(x*d
^(1/2)*2^(1/2)/Pi^(1/2))-sin(c)*FresnelS(x*d^(1/2)*2^(1/2)/Pi^(1/2))))

________________________________________________________________________________________

Maxima [C]  time = 1.25833, size = 743, normalized size = 3.97 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x^2,x, algorithm="maxima")

[Out]

-1/4*sqrt(x^2*abs(d))*(((I*gamma(-1/2, I*d*x^2) - I*gamma(-1/2, -I*d*x^2))*cos(1/4*pi + 1/2*arctan2(0, d)) + (
I*gamma(-1/2, I*d*x^2) - I*gamma(-1/2, -I*d*x^2))*cos(-1/4*pi + 1/2*arctan2(0, d)) - (gamma(-1/2, I*d*x^2) + g
amma(-1/2, -I*d*x^2))*sin(1/4*pi + 1/2*arctan2(0, d)) + (gamma(-1/2, I*d*x^2) + gamma(-1/2, -I*d*x^2))*sin(-1/
4*pi + 1/2*arctan2(0, d)))*cos(c) + ((gamma(-1/2, I*d*x^2) + gamma(-1/2, -I*d*x^2))*cos(1/4*pi + 1/2*arctan2(0
, d)) + (gamma(-1/2, I*d*x^2) + gamma(-1/2, -I*d*x^2))*cos(-1/4*pi + 1/2*arctan2(0, d)) + (I*gamma(-1/2, I*d*x
^2) - I*gamma(-1/2, -I*d*x^2))*sin(1/4*pi + 1/2*arctan2(0, d)) + (-I*gamma(-1/2, I*d*x^2) + I*gamma(-1/2, -I*d
*x^2))*sin(-1/4*pi + 1/2*arctan2(0, d)))*sin(c))*a*b/x + 1/16*(sqrt(2)*sqrt(x^2*abs(d))*(((gamma(-1/2, 2*I*d*x
^2) + gamma(-1/2, -2*I*d*x^2))*cos(1/4*pi + 1/2*arctan2(0, d)) + (gamma(-1/2, 2*I*d*x^2) + gamma(-1/2, -2*I*d*
x^2))*cos(-1/4*pi + 1/2*arctan2(0, d)) + (I*gamma(-1/2, 2*I*d*x^2) - I*gamma(-1/2, -2*I*d*x^2))*sin(1/4*pi + 1
/2*arctan2(0, d)) + (-I*gamma(-1/2, 2*I*d*x^2) + I*gamma(-1/2, -2*I*d*x^2))*sin(-1/4*pi + 1/2*arctan2(0, d)))*
cos(2*c) + ((-I*gamma(-1/2, 2*I*d*x^2) + I*gamma(-1/2, -2*I*d*x^2))*cos(1/4*pi + 1/2*arctan2(0, d)) + (-I*gamm
a(-1/2, 2*I*d*x^2) + I*gamma(-1/2, -2*I*d*x^2))*cos(-1/4*pi + 1/2*arctan2(0, d)) + (gamma(-1/2, 2*I*d*x^2) + g
amma(-1/2, -2*I*d*x^2))*sin(1/4*pi + 1/2*arctan2(0, d)) - (gamma(-1/2, 2*I*d*x^2) + gamma(-1/2, -2*I*d*x^2))*s
in(-1/4*pi + 1/2*arctan2(0, d)))*sin(2*c)) - 8)*b^2/x - a^2/x

________________________________________________________________________________________

Fricas [A]  time = 2.16197, size = 439, normalized size = 2.35 \begin{align*} \frac{2 \, \sqrt{2} \pi a b x \sqrt{\frac{d}{\pi }} \cos \left (c\right ) \operatorname{C}\left (\sqrt{2} x \sqrt{\frac{d}{\pi }}\right ) - 2 \, \sqrt{2} \pi a b x \sqrt{\frac{d}{\pi }} \operatorname{S}\left (\sqrt{2} x \sqrt{\frac{d}{\pi }}\right ) \sin \left (c\right ) + \pi b^{2} x \sqrt{\frac{d}{\pi }} \cos \left (2 \, c\right ) \operatorname{S}\left (2 \, x \sqrt{\frac{d}{\pi }}\right ) + \pi b^{2} x \sqrt{\frac{d}{\pi }} \operatorname{C}\left (2 \, x \sqrt{\frac{d}{\pi }}\right ) \sin \left (2 \, c\right ) + b^{2} \cos \left (d x^{2} + c\right )^{2} - 2 \, a b \sin \left (d x^{2} + c\right ) - a^{2} - b^{2}}{x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x^2,x, algorithm="fricas")

[Out]

(2*sqrt(2)*pi*a*b*x*sqrt(d/pi)*cos(c)*fresnel_cos(sqrt(2)*x*sqrt(d/pi)) - 2*sqrt(2)*pi*a*b*x*sqrt(d/pi)*fresne
l_sin(sqrt(2)*x*sqrt(d/pi))*sin(c) + pi*b^2*x*sqrt(d/pi)*cos(2*c)*fresnel_sin(2*x*sqrt(d/pi)) + pi*b^2*x*sqrt(
d/pi)*fresnel_cos(2*x*sqrt(d/pi))*sin(2*c) + b^2*cos(d*x^2 + c)^2 - 2*a*b*sin(d*x^2 + c) - a^2 - b^2)/x

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\left (a + b \sin{\left (c + d x^{2} \right )}\right )^{2}}{x^{2}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x**2+c))**2/x**2,x)

[Out]

Integral((a + b*sin(c + d*x**2))**2/x**2, x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (b \sin \left (d x^{2} + c\right ) + a\right )}^{2}}{x^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+b*sin(d*x^2+c))^2/x^2,x, algorithm="giac")

[Out]

integrate((b*sin(d*x^2 + c) + a)^2/x^2, x)